<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2021/10/6
  Time: 12:29
  To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.net.URLDecoder" %>
<%@ page pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>

<html>

<style>
    @keyframes example {
        0% {
            background-color: red;
            transform: rotateY(0deg) translateZ(100px);
        }

        25% {
            background-color: yellow;
        }

        50% {
            background-color: blue;
            transform: rotateY(360deg) translateZ(100px);
        }

        100% {
            background-color: green;

        }
    }

    @keyframes E {
        0% {
            box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.4);

        }

        100% {
            box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
        }
    }

    .box {
        animation-name: E;
        animation-iteration-count: infinite;
        animation-duration: 5s;
    }

    /* #title {
        background-color: red;
        animation-name: example;
        animation-duration: 5s;
        animation-iteration-count: infinite;
    } */

    body {
        background-image: url(background/天蓝.jpg);
        background-repeat: no-repeat;
        background-position: 100%;
        height: 100vh;
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }
</style>
<%
    String username="";
    String password="";
    //获取cookie里面的值
    Cookie [] cookies = request.getCookies();
    if(cookies!=null){
        //遍历cookie
        for(int i = 0;i<cookies.length;i++){
            if(cookies[i].getName().equals("username")){
                //获取cookie里面的用户名
                username = URLDecoder.decode(cookies[i].getValue(),"UTF-8");
            }else if(cookies[i].getName().equals("password")){
                //获取密码
                password = URLDecoder.decode(cookies[i].getValue(),"utf-8");
            }
        }
    }
%>
<iframe
        title="Inline Frame Example"
        width="747px"
        height="260px"
        src="background/logo.png">
</iframe>
<body>
<h1 style="color: aquamarine;" id="title">
    登录页面
</h1>
<!-- <img src="./天蓝.jpg"> -->
<form action="login" style="color: bisque;" method="post">
    用户名:<br>
    <input class="box" type="text" name="username" value=<%=username%> >
    <br>
    密码:<br>
    <input class="box"  type="password" name="password"  value=<%=password%>><br>
    <input type="checkbox" name="remember" value="remember" >记住用户名和密码<br>
    <input type="submit" value="登录" name="login">
</form>
</body>

</html>
